package cn.yunhe.springmvc.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.SessionAttributes;
import cn.yunhe.springmvc.model.User;

/**
 * 会话控制器(用HttpSession SERVLET-API实现)
 * 
 * @author YUNEH
 *
 */
@Controller
@RequestMapping("session31")
@SessionAttributes("currentUser")
public class SessionController31 {
	
	
	@RequestMapping(value="/showHome",method=RequestMethod.GET)
	public String home(@ModelAttribute("currentUser") User user){
		System.out.println("会话用户信息为："+user);
		//返回会员中心
		return "home";
	}
	
}
